package com.ieei.client.client;

import com.ieei.client.config.FeignLogConfiguration;
import com.ieei.model.JWT;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "oauth-server",url = "127.0.0.1:8080",fallback = AuthServiceHystrix.class,configuration = FeignLogConfiguration.class)
public interface AuthServiceClient {

    /**
     * @Author Plank
     * @Description 获取token
     * @Date 18:32 2019/5/13
     * @Param [authorization, grantType, username, password]
     * @return com.ieei.model.JWT
     **/
    @PostMapping(value = "/oauth/token")
    JWT getToken(@RequestHeader(value = "Authorization") String authorization,@RequestParam("grant_type") String grantType,@RequestParam("username") String username,@RequestParam("password") String password);
}
